<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo $title ; ?></title>
    <!-- Bootstrap -->
    <link href="/theme/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="/theme/bootstrapSwitch.css">
	<script type="text/javascript" src="/theme/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="/theme/js/highcharts.js"></script>
	<script type="text/javascript" src="/theme/js/exporting.js"></script>
<style>
.col-md-5 .table tbody tr td {
	padding: 3px;
}
</style>

<script type="text/javascript">
$(function () {                                                                
    $('#container1').highcharts({                                           
        chart: {                                                           
            type: 'bar'                                                    
        },                                                                 
        title: {                                                           
            text: '彩票分析助手'                    
        },                                                                 
        subtitle: {                                                        
            text: null                             
        },                                                                 
        xAxis: {                                                           
            categories: <?php echo $xAxis1 ; ?>,
            title: {                                                       
                text:'球号'                                            
            }                                                              
        },                                                                 
        yAxis: {                                                           
            min: 0,                                                        
            title: {                                                       
                text: '出现次数',                             
                align: 'high'                                              
            },                                                             
            labels: {                                                      
                overflow: 'justify'                                        
            }                                                              
        },                                                                 
        tooltip: {                                                         
            valueSuffix: ' 次'                                       
        },                                                                 
        plotOptions: {                                                     
            bar: {                                                         
                dataLabels: {                                              
                    enabled: true                                          
                }                                                          
            }                                                              
        },                                                                 
        legend: {                                                          
            layout: 'vertical',                                            
            align: 'right',                                                
            verticalAlign: 'top',                                          
            x: -40,                                                        
            y: 100,                                                        
            floating: true,                                                
            borderWidth: 1,                                                
            backgroundColor: '#FFFFFF',                                    
            shadow: true                                                   
        },                                                                 
        credits: {                                                         
            enabled: false                                                 
        },                                                                 
        series: [{                                                         
            name: '出现次数',                                             
            data: <?php echo $yAxis1 ; ?>                                   
        }]                                                                 
    });                                                                    
});
</script>
  </head>
  <body>

	<?php
		$current_page = $_SERVER['REQUEST_URI'] ;
		$page = array('index','dlt','qlc') ;
		foreach($page as $p){
			if(strpos($current_page,$p))
				$class[$p] = 'class="active"' ;
			else
				$class[$p] = '' ;
		}

		foreach($qs as $p1){
			$p = $p1->qishu;
			if($p1->qishu){
				if(strpos($current_page,$p))
					$class1[$p] = 'class="active"' ;
				else
					$class1[$p] = '' ;
			}
		}
	?>

    <div class="container theme-showcase" role="main">
		<h1 style="text-align:center;">彩票分析助手</h1>
		<br><br>
		<ul class="nav nav-tabs" role="tablist">
			<li role="presentation" <?php echo $class['index']; ?>><a href="index?qs=<?php echo $ssq_qs[0]->qishu ; ?>">淘宝双色球</a></li>
			<li role="presentation" <?php echo $class['dlt']; ?>><a href="dlt?qs=<?php echo $dlt_qs[0]->qishu ; ?>">淘宝大乐透</a></li>
			<li role="presentation" <?php echo $class['qlc']; ?>><a href="qlc?qs=<?php echo $qlc_qs[0]->qishu ; ?>">淘宝七乐彩</a></li>
		</ul>
		<br>

	<ul class="nav nav-pills" role="tablist">
	<?php foreach($qs as $q1): ?>
	<?php $q = $q1->qishu  ; ?>
	<?php 	if($q): ?>
	  <li role="presentation" <?php echo $class1[$q]; ?>><a href="?qs=<?php echo $q ; ?>"><?php echo $q ; ?>期</a></li>
	  <?php endif  ; ?>
	  <?php endforeach; ?>
	</ul><br>
	<div><p><span  style="color:red;font-size: 28px;">开奖号码： <?php echo @$result->qiuhao?@$result->qiuhao:'开奖中' ; ?></span>  &nbsp;&nbsp;&nbsp;&nbsp;本期销量 <?php echo @$result->sales ; ?> 元（<?php echo @$result->date ; ?>）</p></div>
	<br>

      <!-- Main jumbotron for a primary marketing message or call to action -->
      <div class="jumbotron">
		<form class="form-horizontal" role="form" action="?qs=<?php echo @$qs1 ; ?>" type="get">
		  <div class="form-group">
			<label for="inputEmail3" class="col-sm-2 control-label">号码</label>
			<div class="col-sm-10">
			<input type="hidden" name="qs" value="<?php echo @$qs1 ; ?>">
			  <input type="text" name="number" class="form-control search-query input-medium" id="inputEmail3" placeholder="每个球之间用空格隔开" value="<?php echo @$number; ?>">
			</div>
		  </div>
		  <div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
			  <button type="submit" class="btn btn-default">搜索</button>
			</div>
		  </div>
		</form>

		<?php if(!empty($outs)): ?>
		<p><?php echo '共<span style="color:red;">'.count(@$outs).'</span>注选球:'; ?></p>
		<table class="table  table-hover table-bordered">
		  <thead>
			<tr>
			  <th>球号</th>
			  <th>发起者</th>
			  <th>方案</th>
			  <th>发起时间</th>
			  <th>url</th>
			</tr>
		  </thead>
		  <tbody>
		<?php foreach($outs as $out): ?>
			<?php foreach($num_arr as $n): ?>
				<?php $out->qiuhao = str_replace($n,"<span style='color:black; background-image:url(../theme/images/ball_red.gif); width:20px;'>$n</span>",$out->qiuhao); ?>
			<?php endforeach; ?>
			<tr><td><?php echo $out->qiuhao; ?></td><td><?php echo $out->username; ?></td><td><strong><?php echo $out->amounts; ?>元</strong> / <?php echo $out->numbers; ?> / 每份<?php echo $out->pie; ?></td><td><?php echo $out->times; ?></td><td><a href="<?php echo @$out->PageUrl; ?>" target="_blank">go</a></td></tr>
		<?php endforeach; ?>
		<?php endif; ?>
		  </tbody>
		</table>

      </div>

<!-- 横向排列 -->
  <!-- <div class="row">
  	<table class="table  table-hover table-bordered">
      <tbody>
		<tr>
		<?php if(!empty($reds)): ?>
		<?php  foreach ($reds as $key => $red):  ?>
			<td><?php echo "<div style='color:black; background-image:url(../theme/images/ball_red.gif); width:24px;height:24px;padding:2px 4px;'>".$key."</div>" ; ?></td>
		<?php endforeach; ?>
		<?php endif; ?>
		</tr>

		<tr>
		<?php if(!empty($reds)): ?>
		<?php  foreach ($reds as $key => $red):  ?>
			<td><?php echo $red ; ?></td>
		<?php endforeach; ?>
		<?php endif; ?>
		</tr>

		<tr>
		<?php if(!empty($reds)): ?>
		<?php  foreach ($reds as $key => $red):  ?>
			<td><input type="checkbox" value=""></td>
		<?php endforeach; ?>
		<?php endif; ?>
		</tr>
      </tbody>
    </table>
  </div> -->


<?php if(empty($outs)): ?>
<!-- 曲线图 -->
 <div id="container1" style="width:800px;height:700px"></div>


  <div class="row">
  <div class="col-md-5">
	<table class="table  table-hover table-bordered">
	<caption>红球区</caption>
      <thead>
        <tr>
          <th style="width: 50px;">顺序</th>
          <th>球号</th>
          <th>出现次数</th>
          <th>开奖号</th>
          <th>杀号</th>
        </tr>
      </thead>
      <tbody>
		<?php if(!empty($reds)): ?>
		<?php 	$i = 1 ; ?>
		<?php  foreach ($reds as $key => $red):  ?>
		<?php  
			if($key < 12) $class="success" ;
			if($key >11 && $key < 23) $class="danger" ;
			if($key > 22) $class="warning" ;
			//if($key%4 == 3) $class="danger" ;
		?>
        <tr class="<?php echo $class; ?>">
			<td><?php echo $i ; ?></td>
          <td><?php echo "<div style='float:left;color:black; background-image:url(../theme/images/ball_red.gif); width:24px;height:24px;padding:2px 4px;'>".$key."</div>" ; ?>&nbsp;&nbsp;&nbsp;&nbsp;
		  <div class="switch switch-mini" data-on-label="√" data-off-label="&nbsp;&nbsp;" data-animated="true"><input type="checkbox" /></div>
		  </td>
          <td><?php echo $red ; ?></td>
		<?php if(in_array($key,$red_result)): ?>
			<td><input type="checkbox" value="" checked></td>
		<?php else: ?>
			<td>&nbsp;</td>
		<?php endif; ?>

		<?php if(in_array($key,$red_exclude_result)): ?>
			<td><input type="checkbox" value="" checked></td>
		<?php else: ?>
			<td>&nbsp;</td>
		<?php endif; ?>
        </tr>
		<?php $i++  ; ?>
		<?php endforeach; ?>
		<?php endif; ?>
      </tbody>
    </table>
    </div>

    <div class="col-md-1"></div>

    <div class="col-md-5">
	<table class="table  table-hover table-bordered">
	<caption>蓝球区</caption>
      <thead>
        <tr>
          <th style="width: 50px;">顺序</th>
          <th>球号</th>
          <th>出现次数</th>
          <th>开奖号</th>
          <th>杀号</th>
        </tr>
      </thead>
      <tbody>
		<?php if(!empty($blues)): ?>
		<?php 	$j = 1 ; ?>
		<?php  foreach ($blues as $key => $blue):  ?>
		<?php  
			if($key%4 == 0) $class="success" ;
			if($key%4 == 1) $class="info" ;
			if($key%4 == 2) $class="warning" ;
			if($key%4 == 3) $class="danger" ;
		?>
        <tr class="<?php echo ''; ?>">
			<td><?php echo $j ; ?></td>
			<td><?php echo "<div style='float:left;color:black; background-image:url(../theme/images/ball_blue.gif); width:24px;height:24px;padding:2px 4px;'>".$key."</div>" ; ?>&nbsp;&nbsp;&nbsp;&nbsp;
			<div class="switch switch-mini" data-on-label="√" data-off-label="&nbsp;&nbsp;" data-animated="true"><input type="checkbox" /></div>
			</td>
			<td><?php echo $blue ; ?></td>

			<?php if(in_array($key,$blue_result)): ?>
			<td><input type="checkbox" value="" checked></td>
			<?php else: ?>
			<td>&nbsp;</td>
			<?php endif; ?>

			<?php if(in_array($key,$blue_exclude_result)): ?>
			<td><input type="checkbox" value="" checked></td>
			<?php else: ?>
			<td>&nbsp;</td>
			<?php endif; ?>
		</tr>
		<?php $j++  ; ?>
		<?php endforeach; ?>
		<?php endif; ?>
      </tbody>
    </table>
    </div>

  </div>
<?php endif; ?>

<br><br>
  <div class="row">
  <div class="col-md-8">
<?php if(!empty($red_tui)): ?>
	<table class="table  table-hover table-bordered">
	<caption>推荐号码：</caption>
		<?php  foreach ($red_tui as $key => $tui):  ?>
		<?php if(!empty($tui)): ?>
			<tr style=""><td ><h4><?php echo $tui ; ?></h4></td></tr>
		<?php endif; ?>
		<?php endforeach; ?>
    </table>
<?php endif; ?>
    </div>
    </div>
<br>

</div>


    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="/theme/js/bootstrap.min.js"></script>
    <script src="/theme/js/bootstrapSwitch.js"></script>
  </body>
</html>
